#ifndef BBH_MESSAGE_H_
#define BBH_MESSAGE_H_
#ifdef __cplusplus
extern "C"
{
#endif

#include "bbh_include.h"

typedef struct bbh_message_s
{
    const char              * filename;
    size_t                  filename_len;
    const char              * shortname;
    size_t                  shortname_len;
    const char              * function;
    size_t                  function_len;
    int                     line;
    pthread_t               thread_id;
    int                     level;
    timeval                 tv;
} bbh_message_t;

int  bbh_message_print(bbh_pattern_t*f, bbh_thread_t*thd, bbh_message_t*msg, const char*fmt, ...);
int  bbh_message_vprint(bbh_pattern_t*f, bbh_thread_t*thd, bbh_message_t*msg,const char*fmt, va_list args);
int  bbh_message_write(bbh_pattern_t*f, bbh_thread_t*thd, bbh_message_t*msg, const char*data, size_t len);

#ifdef __cplusplus
}
#endif
#endif
